package com.curve;

import com.lordor.security.Account;

import java.util.Date;
import java.text.SimpleDateFormat;

/**
 * User: lyj
 * Date: 2011-11-29
 * Time: 14:35:02
 * @hibernate.class table="curve_CurvePoint" dynamic-update="true"
 * dynamic-insert="true"
 */
public class CurvePoint extends SystemCurveBean{
    private Date createDate;
    private Date pointDate;
    private float curveValue;
    private Account user;
    private UserCurve userCurve;


    public CurvePoint() {
        createDate=new Date();
    }
    private SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");

    public String getPointDateStr(){
        if (this.getPointDate()!=null) {
            return sdf.format(this.getPointDate());
        } else{
            return null;
        }
    }

    /**
     * @hibernate.property  not-null="true"  index="CurvePoint_createDate"
     * @return
     */
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }
   /**
     * @hibernate.property
     * @return
     */
    public Date getPointDate() {
        return pointDate;
    }

    public void setPointDate(Date pointDate) {
        this.pointDate = pointDate;
    }
    /**
     * @hibernate.property
     * @return
     */
    public float getCurveValue() {
        return curveValue;
    }

    public void setCurveValue(float curveValue) {
        this.curveValue = curveValue;
    }


    /**
     * @return
     * @hibernate.many-to-one class="com.lordor.security.Account"
     * @hibernate.column name="userID" index="CurvePoint_owner"
     */
    public Account getUser() {
          return user;
      }

      public void setUser(Account user) {
          this.user = user;
      }

    /**
     * @return
     * @hibernate.many-to-one class="com.curve.UserCurve"
     * @hibernate.column name="userCurve" index="CurvePoint_UserCurve"
     */
    public UserCurve getUserCurve() {
        return userCurve;
    }

    public void setUserCurve(UserCurve userCurve) {
        this.userCurve = userCurve;
    }
}
